from base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    # 点击搜索框
    def kuang(self):
        loc=(By.ID,'com.kongfz.app:id/ll_search')
        ele=self.find_ele(loc)
        return ele

    #输入内容
    def write(self):
        loc = (By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele

    # 点击搜索按钮
    def button(self):
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvSearch"]')
        ele = self.find_ele(loc)
        return ele

    #断言
    def shop(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/tvGoods")')
        ele=self.find_ele(loc)
        return ele

    def book(self):
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().text("书目")')
        ele = self.find_ele(loc)
        return ele

    def buy(self):
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().text("拍卖")')
        ele = self.find_ele(loc)
        return ele